import 'package:safetymonitor/generated/json/base/json_convert_content.dart';
import 'package:safetymonitor/app/data/entities/home/duty/duty_mgmt_day_entity.dart';

DutyMgmtDayEntity $DutyMgmtDayEntityFromJson(Map<String, dynamic> json) {
  final DutyMgmtDayEntity dutyMgmtDayEntity = DutyMgmtDayEntity();
  final int? id = jsonConvert.convert<int>(json['id']);
  if (id != null) {
    dutyMgmtDayEntity.id = id;
  }
  final int? companyId = jsonConvert.convert<int>(json['companyId']);
  if (companyId != null) {
    dutyMgmtDayEntity.companyId = companyId;
  }
  final String? companyName = jsonConvert.convert<String>(json['companyName']);
  if (companyName != null) {
    dutyMgmtDayEntity.companyName = companyName;
  }
  final int? scheduleInfoId = jsonConvert.convert<int>(json['scheduleInfoId']);
  if (scheduleInfoId != null) {
    dutyMgmtDayEntity.scheduleInfoId = scheduleInfoId;
  }
  final int? planDutyPersonId = jsonConvert.convert<int>(json['planDutyPersonId']);
  if (planDutyPersonId != null) {
    dutyMgmtDayEntity.planDutyPersonId = planDutyPersonId;
  }
  final String? planDutyPerson = jsonConvert.convert<String>(json['planDutyPerson']);
  if (planDutyPerson != null) {
    dutyMgmtDayEntity.planDutyPerson = planDutyPerson;
  }
  final String? planDutyPersonPhone = jsonConvert.convert<String>(json['planDutyPersonPhone']);
  if (planDutyPersonPhone != null) {
    dutyMgmtDayEntity.planDutyPersonPhone = planDutyPersonPhone;
  }
  final String? planDutyPersonPosition = jsonConvert.convert<String>(json['planDutyPersonPosition']);
  if (planDutyPersonPosition != null) {
    dutyMgmtDayEntity.planDutyPersonPosition = planDutyPersonPosition;
  }
  final String? planDutyPersonUnit = jsonConvert.convert<String>(json['planDutyPersonUnit']);
  if (planDutyPersonUnit != null) {
    dutyMgmtDayEntity.planDutyPersonUnit = planDutyPersonUnit;
  }
  final String? planDutyPersonDept = jsonConvert.convert<String>(json['planDutyPersonDept']);
  if (planDutyPersonDept != null) {
    dutyMgmtDayEntity.planDutyPersonDept = planDutyPersonDept;
  }
  final int? planDutyLeaderId = jsonConvert.convert<int>(json['planDutyLeaderId']);
  if (planDutyLeaderId != null) {
    dutyMgmtDayEntity.planDutyLeaderId = planDutyLeaderId;
  }
  final String? planDutyLeader = jsonConvert.convert<String>(json['planDutyLeader']);
  if (planDutyLeader != null) {
    dutyMgmtDayEntity.planDutyLeader = planDutyLeader;
  }
  final String? planDutyLeaderPhone = jsonConvert.convert<String>(json['planDutyLeaderPhone']);
  if (planDutyLeaderPhone != null) {
    dutyMgmtDayEntity.planDutyLeaderPhone = planDutyLeaderPhone;
  }
  final int? scheduleConfigId = jsonConvert.convert<int>(json['scheduleConfigId']);
  if (scheduleConfigId != null) {
    dutyMgmtDayEntity.scheduleConfigId = scheduleConfigId;
  }
  final String? scheduleName = jsonConvert.convert<String>(json['scheduleName']);
  if (scheduleName != null) {
    dutyMgmtDayEntity.scheduleName = scheduleName;
  }
  final int? actualDutyPersonId = jsonConvert.convert<int>(json['actualDutyPersonId']);
  if (actualDutyPersonId != null) {
    dutyMgmtDayEntity.actualDutyPersonId = actualDutyPersonId;
  }
  final String? actualDutyPerson = jsonConvert.convert<String>(json['actualDutyPerson']);
  if (actualDutyPerson != null) {
    dutyMgmtDayEntity.actualDutyPerson = actualDutyPerson;
  }
  final String? actualDutyPersonPhone = jsonConvert.convert<String>(json['actualDutyPersonPhone']);
  if (actualDutyPersonPhone != null) {
    dutyMgmtDayEntity.actualDutyPersonPhone = actualDutyPersonPhone;
  }
  final String? actualDutyPersonPosition = jsonConvert.convert<String>(json['actualDutyPersonPosition']);
  if (actualDutyPersonPosition != null) {
    dutyMgmtDayEntity.actualDutyPersonPosition = actualDutyPersonPosition;
  }
  final String? actualDutyPersonUnit = jsonConvert.convert<String>(json['actualDutyPersonUnit']);
  if (actualDutyPersonUnit != null) {
    dutyMgmtDayEntity.actualDutyPersonUnit = actualDutyPersonUnit;
  }
  final String? actualDutyPersonDept = jsonConvert.convert<String>(json['actualDutyPersonDept']);
  if (actualDutyPersonDept != null) {
    dutyMgmtDayEntity.actualDutyPersonDept = actualDutyPersonDept;
  }
  final int? actualDutyLeaderId = jsonConvert.convert<int>(json['actualDutyLeaderId']);
  if (actualDutyLeaderId != null) {
    dutyMgmtDayEntity.actualDutyLeaderId = actualDutyLeaderId;
  }
  final String? actualDutyLeader = jsonConvert.convert<String>(json['actualDutyLeader']);
  if (actualDutyLeader != null) {
    dutyMgmtDayEntity.actualDutyLeader = actualDutyLeader;
  }
  final String? actualDutyLeaderPhone = jsonConvert.convert<String>(json['actualDutyLeaderPhone']);
  if (actualDutyLeaderPhone != null) {
    dutyMgmtDayEntity.actualDutyLeaderPhone = actualDutyLeaderPhone;
  }
  final String? dutyDate = jsonConvert.convert<String>(json['dutyDate']);
  if (dutyDate != null) {
    dutyMgmtDayEntity.dutyDate = dutyDate;
  }
  final String? onDutyTime = jsonConvert.convert<String>(json['onDutyTime']);
  if (onDutyTime != null) {
    dutyMgmtDayEntity.onDutyTime = onDutyTime;
  }
  final String? offDutyTime = jsonConvert.convert<String>(json['offDutyTime']);
  if (offDutyTime != null) {
    dutyMgmtDayEntity.offDutyTime = offDutyTime;
  }
  final String? weatherInfo = jsonConvert.convert<String>(json['weatherInfo']);
  if (weatherInfo != null) {
    dutyMgmtDayEntity.weatherInfo = weatherInfo;
  }
  final String? majorEventInfoId = jsonConvert.convert<String>(json['majorEventInfoId']);
  if (majorEventInfoId != null) {
    dutyMgmtDayEntity.majorEventInfoId = majorEventInfoId;
  }
  final String? floodPreventionInfo = jsonConvert.convert<String>(json['floodPreventionInfo']);
  if (floodPreventionInfo != null) {
    dutyMgmtDayEntity.floodPreventionInfo = floodPreventionInfo;
  }
  final String? createTime = jsonConvert.convert<String>(json['createTime']);
  if (createTime != null) {
    dutyMgmtDayEntity.createTime = createTime;
  }
  return dutyMgmtDayEntity;
}

Map<String, dynamic> $DutyMgmtDayEntityToJson(DutyMgmtDayEntity entity) {
  final Map<String, dynamic> data = <String, dynamic>{};
  data['id'] = entity.id;
  data['companyId'] = entity.companyId;
  data['companyName'] = entity.companyName;
  data['scheduleInfoId'] = entity.scheduleInfoId;
  data['planDutyPersonId'] = entity.planDutyPersonId;
  data['planDutyPerson'] = entity.planDutyPerson;
  data['planDutyPersonPhone'] = entity.planDutyPersonPhone;
  data['planDutyPersonPosition'] = entity.planDutyPersonPosition;
  data['planDutyPersonUnit'] = entity.planDutyPersonUnit;
  data['planDutyPersonDept'] = entity.planDutyPersonDept;
  data['planDutyLeaderId'] = entity.planDutyLeaderId;
  data['planDutyLeader'] = entity.planDutyLeader;
  data['planDutyLeaderPhone'] = entity.planDutyLeaderPhone;
  data['scheduleConfigId'] = entity.scheduleConfigId;
  data['scheduleName'] = entity.scheduleName;
  data['actualDutyPersonId'] = entity.actualDutyPersonId;
  data['actualDutyPerson'] = entity.actualDutyPerson;
  data['actualDutyPersonPhone'] = entity.actualDutyPersonPhone;
  data['actualDutyPersonPosition'] = entity.actualDutyPersonPosition;
  data['actualDutyPersonUnit'] = entity.actualDutyPersonUnit;
  data['actualDutyPersonDept'] = entity.actualDutyPersonDept;
  data['actualDutyLeaderId'] = entity.actualDutyLeaderId;
  data['actualDutyLeader'] = entity.actualDutyLeader;
  data['actualDutyLeaderPhone'] = entity.actualDutyLeaderPhone;
  data['dutyDate'] = entity.dutyDate;
  data['onDutyTime'] = entity.onDutyTime;
  data['offDutyTime'] = entity.offDutyTime;
  data['weatherInfo'] = entity.weatherInfo;
  data['majorEventInfoId'] = entity.majorEventInfoId;
  data['floodPreventionInfo'] = entity.floodPreventionInfo;
  data['createTime'] = entity.createTime;
  return data;
}

extension DutyMgmtDayEntityExtension on DutyMgmtDayEntity {
  DutyMgmtDayEntity copyWith({
    int? id,
    int? companyId,
    String? companyName,
    int? scheduleInfoId,
    int? planDutyPersonId,
    String? planDutyPerson,
    String? planDutyPersonPhone,
    String? planDutyPersonPosition,
    String? planDutyPersonUnit,
    String? planDutyPersonDept,
    int? planDutyLeaderId,
    String? planDutyLeader,
    String? planDutyLeaderPhone,
    int? scheduleConfigId,
    String? scheduleName,
    int? actualDutyPersonId,
    String? actualDutyPerson,
    String? actualDutyPersonPhone,
    String? actualDutyPersonPosition,
    String? actualDutyPersonUnit,
    String? actualDutyPersonDept,
    int? actualDutyLeaderId,
    String? actualDutyLeader,
    String? actualDutyLeaderPhone,
    String? dutyDate,
    String? onDutyTime,
    String? offDutyTime,
    String? weatherInfo,
    String? majorEventInfoId,
    String? floodPreventionInfo,
    String? createTime,
  }) {
    return DutyMgmtDayEntity()
      ..id = id ?? this.id
      ..companyId = companyId ?? this.companyId
      ..companyName = companyName ?? this.companyName
      ..scheduleInfoId = scheduleInfoId ?? this.scheduleInfoId
      ..planDutyPersonId = planDutyPersonId ?? this.planDutyPersonId
      ..planDutyPerson = planDutyPerson ?? this.planDutyPerson
      ..planDutyPersonPhone = planDutyPersonPhone ?? this.planDutyPersonPhone
      ..planDutyPersonPosition = planDutyPersonPosition ?? this.planDutyPersonPosition
      ..planDutyPersonUnit = planDutyPersonUnit ?? this.planDutyPersonUnit
      ..planDutyPersonDept = planDutyPersonDept ?? this.planDutyPersonDept
      ..planDutyLeaderId = planDutyLeaderId ?? this.planDutyLeaderId
      ..planDutyLeader = planDutyLeader ?? this.planDutyLeader
      ..planDutyLeaderPhone = planDutyLeaderPhone ?? this.planDutyLeaderPhone
      ..scheduleConfigId = scheduleConfigId ?? this.scheduleConfigId
      ..scheduleName = scheduleName ?? this.scheduleName
      ..actualDutyPersonId = actualDutyPersonId ?? this.actualDutyPersonId
      ..actualDutyPerson = actualDutyPerson ?? this.actualDutyPerson
      ..actualDutyPersonPhone = actualDutyPersonPhone ?? this.actualDutyPersonPhone
      ..actualDutyPersonPosition = actualDutyPersonPosition ?? this.actualDutyPersonPosition
      ..actualDutyPersonUnit = actualDutyPersonUnit ?? this.actualDutyPersonUnit
      ..actualDutyPersonDept = actualDutyPersonDept ?? this.actualDutyPersonDept
      ..actualDutyLeaderId = actualDutyLeaderId ?? this.actualDutyLeaderId
      ..actualDutyLeader = actualDutyLeader ?? this.actualDutyLeader
      ..actualDutyLeaderPhone = actualDutyLeaderPhone ?? this.actualDutyLeaderPhone
      ..dutyDate = dutyDate ?? this.dutyDate
      ..onDutyTime = onDutyTime ?? this.onDutyTime
      ..offDutyTime = offDutyTime ?? this.offDutyTime
      ..weatherInfo = weatherInfo ?? this.weatherInfo
      ..majorEventInfoId = majorEventInfoId ?? this.majorEventInfoId
      ..floodPreventionInfo = floodPreventionInfo ?? this.floodPreventionInfo
      ..createTime = createTime ?? this.createTime;
  }
}